<?php
/**
 *      eaiis - Estate Agency Internet Information System
 *
 *      This application is designed to provide scalable managment of
 * 		Estate Agency products.
 * 
 * 		Powered on MySQL 5.0, PHP 5.2.10, XHTML 1.1, CSS 2.0., JavaScript 1.8
 *
 *      Copyright (c) 2009 Vavra Stepan. All rights reserved. Charles University in Prague
 *
 *      THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
 *      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 *      THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 *      PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
 *      BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 *      CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 *      SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 *      BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 *      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 *      OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 *      IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * 
 * Html code of header which is used on every page.
 * 
 * @package templates
 */
require_once 'include/src/base/_typehint.php';
require_once 'include/src/common/_xmlreaderex.php';
require_once 'include/src/common/_error.php';

$cm = CodeManager::getCodeManager();
$info = SiteContext::getSiteContext();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs">
<head>
	<title><?php echo SiteSeo::getSiteSeo()->title(); ?></title>
	<meta http-equiv="Content-language" content="<?php echo $info->getSiteLang()->getLang(); ?>" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="keywords" content="<?php echo SiteSeo::getSiteSeo()->keywords(); ?>" />
	<meta name="description" content="<?php echo SiteSeo::getSiteSeo()->description(); ?>" />
	<meta http-equiv="author" content="<?php echo $cm->get("20003"); ?>" />
	<meta name="verify-v1" content="AvMgXM5vEHNpxwxXlyFjYglDvF4oC46Pw9qsNWbI76k=" />
	
	<link rel="shortcut icon" href="<?php echo $info->getSiteInf()->getPathWebImg(); ?>/f-real_logo_white_f.png"/>
	
	<link rel="stylesheet" href="<?php echo $info->getSiteInf()->getPathWebCSS(); ?>/main.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo $info->getSiteInf()->getPathWebCSS(); ?>/admin.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo $info->getSiteInf()->getPathWebCSS(); ?>/form.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo $info->getSiteInf()->getPathWebCSS(); ?>/offer-list.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo $info->getSiteInf()->getPathWebCSS(); ?>/offer-thumb.css" type="text/css" />
	
	<script type="text/javascript" src="/js/onload.js"></script>
	<script type="text/javascript" src="/js/console.js"></script>
	<script type="text/javascript" src="/js/common.js"></script>
	<script type="text/javascript" src="/js/errormsg.js"></script>
	<script type="text/javascript" src="/js/json2.js"></script>
	<script type="text/javascript" src="/js/shield.js"></script>
	<script type="text/javascript" src="/js/ajax.js"></script>
	<script type="text/javascript" src="/js/search.js"></script>
	
	

</head>
<body>
<?php 
	if (Policy::isAdminView()) {
		require 'adminbox.php'; // TODO menu shouldn't be redundant
?>
<dl id="menu" class="center-horizontal">
	<dt>
	</dt>
	<dd>
		<a href="<?php echo "?".Constants::REQ_LANG."=".Constants::REQ_LANG_CS; ?>">Čeština</a>
		&nbsp;|&nbsp;
		<a href="<?php echo "?".Constants::REQ_LANG."=".Constants::REQ_LANG_DE; ?>">Deutsch</a>
		&nbsp;|&nbsp;
		<a href="<?php echo "?".Constants::REQ_LANG."=".Constants::REQ_LANG_EN; ?>">English</a>
	</dd>
</dl>
<?php 
	} else { ?>
<div id="header" class="framed">
	<ul>
		<li class="left"><a href="<?php echo Constants::WEB_DEFAULTPAGE; ?>"><img src="/img/f-real_logo.png" alt="F-Real logo" /></a></li>
		<li class="right"><img src="/img/banner5.png" alt="banner" /></li>
	</ul>
</div>
<dl id="menu" class="center-horizontal">
	<dt>
		<a href="<?php echo "/?".Constants::REQ_ACTION."=".Constants::REQ_ACTION_THUMBOFFER?>" title="<?php echo $cm->get("30087"); ?>"><?php echo $cm->get("30087"); ?></a>
		&nbsp;|&nbsp;
		<a href="<?php echo "/?".Constants::REQ_ACTION."=".Constants::REQ_ACTION_INTERESTEDIN; ?>" title="<?php echo $cm->get("30088"); ?>"><?php echo $cm->get("30088"); ?></a>
		&nbsp;|&nbsp;
		<a href="<?php echo "/?".Constants::REQ_ACTION."=".Constants::REQ_ACTION_CONTACT; ?>" title="<?php echo $cm->get("30089"); ?>"><?php echo $cm->get("30089"); ?></a>
		&nbsp;|&nbsp;
		<a href="<?php echo "/?".Constants::REQ_ACTION."=".Constants::REQ_ACTION_ABOUT; ?>" title="<?php echo $cm->get("30101"); ?>"><?php echo $cm->get("30101"); ?></a>
	</dt>
	<dd>
		<a href="<?php echo "/?".Constants::REQ_LANG."=".Constants::REQ_LANG_CS; ?>">Čeština</a>
		&nbsp;|&nbsp;
		<a href="<?php echo "/?".Constants::REQ_LANG."=".Constants::REQ_LANG_DE; ?>">Deutsch</a>
		&nbsp;|&nbsp;
		<a href="<?php echo "/?".Constants::REQ_LANG."=".Constants::REQ_LANG_EN; ?>">English</a>
	</dd>
</dl>
<?php 
		echo '<div class="cleaner"></div>';
	}
?>


<div id="container">
	 	<ul id="errormsg">
	 		<li id="_TEMPLATE_ERRORMSG_">
	 			<span class="bold" >Error:</span> Your browser doesn't support JavaScript or it is disabled. Please, enable it or this application won't work. <br/> Or your browser is unsupported.
	 		</li>
	 		<?php
	 			Error::getError()->flushAllMessagesHtml();
	 		?>
	 	</ul>
	 	<script type="text/javascript">
	 		console.log("hiding errormsg template");
	 		var errormsg = Errormsg.getErrormsg();
	 		errormsg.template.style.visibility = "hidden";
	 		errormsg.template.style.position = "absolute";
	 		console.log("hiding errormsg template .. OK");
	 	</script>
